package com.bupt.ilink.jwt;

import lombok.Getter;
import org.springframework.security.core.AuthenticationException;

@Getter
public class InvalidJwtAuthenticationException extends AuthenticationException {

    private static final long serialVersionUID = -761503632186596342L;

    private Type type = Type.INVALID;

    public enum Type {
        INVALID,
        EXPIRED;
    }

    /**
     * 表示JWT token无效或过期的异常
 * @param e
     * @return
     * @author liuzheng
     * @create 2024-07-27
     **/

    public InvalidJwtAuthenticationException(String e) {
        super(e);
    }

    public InvalidJwtAuthenticationException(Type type, String message) {
        super(message);
        this.type = type;
    }

}